1 <?php
2  session_start();
3  
if(isset($_SESSION['user']))
4  {
5
6  }
7  
else{
8   echo
"<script>location.href='login.html'</script>";
9  }
10 ?>
11 <html>
12     <head>
13         <title>Saledetails </title>
14         <style>
15
16             body {
17   margin:
0;
18   font-family: Arial, Helvetica, sans-serif;
19   background: #
484848;
20 }
21 .topnav {
22   overflow: hidden;
23   background-color: rgba(
249, 105, 14, 1);
24   height: 70px;
25   border: 3px solid #e69500;
26 }
27
28 .topnav a {
29   
float: left;
30   color: #f2f2f2;
31   text-align: center;
32   padding: 14px 16px;
33   text-decoration: none;
34   font-size: 35px;
35   font-weight: bold;
36 }
37
38 .topnav-right {
39   
float: right;
40 }
41 table {
42     font-family: arial, sans-serif;
43     border-collapse: collapse;
44     outline:#e69500 solid 5px;
45     background: #FAFAFA;
46     width:
100%;
47     margin:5px ;
48 }
49
50 td, th {
51     border: 1px solid #dddddd;
52     text-align: left;
53     padding: 8px;
54 }
55 th{
56     background-color:rgba(
249, 105, 14, 1);
57 }
58
59
60 .custombutton{
61   margin:25px;
62   
63 }input[type=text] {
64     width:
15%;
65     padding: 12px 20px;
66     margin: 8px ;
67     background:transparent;
68     border: 2px solid red;
69 }
70     </style>
71 </head>
72 <body>
73 <div
class="topnav">
74             <a
class="active" href="home.html"><img src="ic_add_pet.png"></a>
75             <a href=
"soldpets.php">sold pets</a>
76             <div
class="topnav-right">
77               <a href=
"logout.php">logout</a>
78             </div>
79           </div>
80           <div
class="custombutton">
81 <form>
82 <button style=
" height: 50px;width: 150px;cursor:pointer;border-radius:15px;
83 border: 3px solid #e69500;background-color: rgba(
249, 105, 14, 1);color:#f2f2f2;font-size:15px;" formaction="sales.php">Back</button>
84 <button style=
" height: 50px;width: 150px;cursor:pointer;border-radius:15px;
85 border: 3px solid #e69500;background-color: rgba(
249, 105, 14, 1);color:#f2f2f2;font-size:15px;" formaction="soldptadd.php">Add new details</button>
86 </form>
87 </div>
88 <?php
89    
90 $con = mysqli_connect(
"localhost","root","","Petshop_management");
91 if
(!$con)
92 {
93 die(
"could not connect".mysql_error());
94 }
95 $
var=mysqli_query($con,"select * from sold_pets ");
96 echo
"<table border size=10>";
97 echo
"<tr>
98 <th>sd_ID</th>
99 <th>pet_id</th>
100 </tr>"
;
101 if
(mysqli_num_rows($var)>0){
102     
while($arr=mysqli_fetch_row($var))
103     { echo
"<tr>
104     <td>$arr[
0]</td>
105     <td>$arr[
1]</td>
106     </tr>"
;}
107     echo
"</table>";
108     mysqli_free_result($
var);
109 }
110
111 mysqli_close($con);
112     
113     
114 ?>
115 <form action=
"deletesoldpt.php" method="post">
116 <input type=
"text" name="t1" placeholder="Enter sales_id to delete" required>
117 <input type=
"text" name="t2" placeholder="Enter pet_id number" required>
118     <input style=
"width:75px;height:44px;cursor:pointer;border-radius:15px;
119 border: 3px solid #e69500;background-color: rgba(
249, 105, 14, 1);color:#f2f2f2;font-size:15px;"type="submit" value="Delete">
120 </form>
121
122 </body>
123 </html>


Gõ tìm kiếm nhanh...